package com.atyang.configuration;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * 如果是单机，定时任务可以这样做
 */
@Configuration
public class TestScheduler {

    private static final Logger logger = LoggerFactory.getLogger(TestScheduler.class);

    @Scheduled(cron = "*/5 * * * * ?")
    public void testSchedulerMethod(){
        System.out.println("定时任务执行中");
    }


}
